import React from "react";
import {useModel} from "@@/plugin-model/useModel";

const initialStateUtil: React.FC<{ user: any }> = ({ user }) => {
  const { initialState, setInitialState } = useModel('@@initialState');
  if (user){
    setInitialState({
      ...initialState,
      currentUser: user
    });
  }else {
    return initialState?.currentUser
  }
}

export default initialStateUtil;
